/////////Set survey weight:
svyset [pweight=weight4]

/////////Download and install needed commands:
findit _gstd01
findit spost13_ado 

/////////Variable Definitions:

//////Age:
egen age01=std01(age)

//////Income:
egen income01=std01(income)

//////Gender:
recode gender (1=1) (2=0)

//////Education:
///Ordinal:
gen educ=degree
egen educ01=std01(educ)

//////Race:
gen white=1 if race==4
replace white=0 if race~=4

//////American identification:
recode w1amer1 (1=1) (2=0), generate(amerid1)

//////Ideology:
gen ideo=w1ideo1
egen ideo011=std01(ideo)

//////Partisanship:
gen ptyid=0 if w1pid1==2 & w1pid2a==1
replace ptyid=1 if w1pid1==2 & w1pid2a==2
replace ptyid=2 if w1pid1==3 & w1pid3==1
replace ptyid=3 if w1pid1==3 & w1pid3==3
replace ptyid=4 if w1pid1==3 & w1pid3==2
replace ptyid=5 if w1pid1==1 & w1pid2b==2
replace ptyid=6 if w1pid1==1 & w1pid2b==1
egen ptyid011=std01(ptyid)

//////Racial Resentment:
gen rrr1=(5-rr1)/4
gen rrr2=(rr2-1)/4
gen rrr3=(rr3-1)/4
gen rrr4=(5-rr4)/4
egen rrscal1=rmean(rrr1 rrr2 rrr3 rrr4)

///Hostile Sexism:
gen rasi1=(w1ambsex1-1)/5
gen rasi2=(w1ambsex2-1)/5
gen rasi3=(w1ambsex3-1)/5
gen rasi4=(w1ambsex4-1)/5 
egen rhsex1=rmean(rasi1-rasi4)

//////Authoritarianism:
gen aut1=1 if w1auth1==2
replace aut1=0 if w1auth1==1 
gen aut2=1 if w1auth2==1
replace aut2=0 if w1auth2==2 
gen aut3=1 if w1auth3==2
replace aut3=0 if w1auth3==1 
gen aut4=1 if w1auth4==2
replace aut4=0 if w1auth4==1 
egen rauth1=rmean(aut1 aut2 aut3 aut4)

//////Economic Dissatisfaction:
gen eret21=(w1retro2-1)/4

//////Trust:
gen tr11=(4-w1trust1)/3
gen tr21=(4-w1trust2)/3
gen tr31=(4-w1trust3)/3
gen tr41=(4-w1trust4)/3
gen tr51=(4-w1trust5)/3
egen trscal1=rmean(tr11 tr21 tr31 tr41 tr51)

//////Collective Narcissism:
gen rcn1=(w4cn1-1)/6
gen rcn2=(w4cn2-1)/6
gen rcn3=(w4cn3-1)/6
gen rcn4=(w4cn4-1)/6
gen rcn5=(w4cn5-1)/6
egen rcnsc4=rmean(rcn1 rcn2 rcn3 rcn4 rcn5)

//////Vote Choice:
///Trump vs Not Trump:
gen trv4=1 if w4vc1==1
replace trv4=0 if w4vc1==2 | w4vc1==3 | w4vc1==4
///Trump vs Not Trump vs Abstain:
gen trv4b=-1 if w4turnout<4
replace trv4b=trv4 if w4turnout==4
tab trv4b, generate(tv)

//////Trump Thermometer:
gen rtdjt3=w3ft8/100

//////Trump Trait Evaluation:
gen rtcomp=(w3rpct1-1)/6
gen rthon=(w3rpct2-1)/6
gen rtreck=(w3rpct4-1)/6
gen rtins=(w3rpct5-1)/6
gen rtwarm=(w3rpct7-1)/6
gen rrtreck=1-rtreck
gen rrtins=1-rtins
egen rttrait3=rmean(rtcomp rthon rtwarm rrtreck rrtins)

//////Net Trump Thermometer:
///Clinton thermometer:
gen rthrc3=w3ft7/100
///Net Score:
svy: reg rtdjt3 rthrc3
predict rdiff2, resid 
egen rdiff2013=std01(rdiff2)

//////Net Trump Trait Evaluation:
///Clinton trait evaluation:
gen rccomp=(w3dpct1-1)/6
gen rchon=(w3dpct2-1)/6
gen rcreck=(w3dpct4-1)/6
gen rcins=(w3dpct5-1)/6
gen rcwarm=(w3dpct7-1)/6
gen rrcreck=1-rcreck
gen rrcins=1-rcins
egen rctrait3=rmean(rccomp rchon rcwarm rrcreck rrcins)
///Net Score:
svy: reg rttrait3 rctrait3
predict rtdiff2, resid 
egen rtdiff2013=std01(rtdiff2) 

/////////MAIN ANALYSES

//////Correlations, Table 1:
pwcorr trv4 rtdjt3 rttrait3 amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4 [aweight=weight4], sig

//////Collective Narcissism Among Different Voter Groups
///Abstainers as Reference Group:
svy: reg rcnsc4 tv2 tv3
margins, at(tv2=(0) tv3=(0))
margins, at(tv2=(0) tv3=(1))
margins, at(tv2=(1) tv3=(0))
///Non-Trump Voters as Reference Group:
svy: reg rcnsc4 tv1 tv3
margins, at(tv1=(0) tv3=(0))
margins, at(tv1=(0) tv3=(1))
margins, at(tv1=(1) tv3=(0))

//////Vote Choice:
///Table 2:
svy: probit trv4 age01 income01 gender educ01 white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4
mchange, stats(ch) brief
///Figure 1:
svy: probit trv4 age01 income01 gender educ01 white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4
quietly margins, at(ideo011=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Ideology", color(black) size(vlarge)) ///
	xtitle("") ytitle("Pr(Trump)") saving (cn4a, replace)
quietly margins, at(ptyid011=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Partisanship", color(black) size(vlarge)) ///
	xtitle("") ytitle("Pr(Trump)") saving (cn4b, replace)	
quietly margins, at(rrscal1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Racial Resentment", color(black) size(vlarge)) ///
	xtitle("") ytitle("Pr(Trump)") saving (cn4c, replace)	
quietly margins, at(rhsex1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Hostile Sexism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Pr(Trump)") saving (cn4d, replace)	
quietly margins, at(rauth1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Authoritarianism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Pr(Trump)") saving (cn4e, replace)
quietly margins, at(eret21=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Economic Dissatisfaction", color(black) size(vlarge)) ///
	xtitle("") ytitle("Pr(Trump)") saving (cn4f, replace)
quietly margins, at(trscal1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Trust", color(black) size(vlarge)) ///
	xtitle("") ytitle("Pr(Trump)") saving (cn4h, replace)
quietly margins, at(rcnsc4=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Collective Narcissism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Pr(Trump)") saving (cn4g, replace)	
graph combine cn4g.gph cn4a.gph cn4b.gph cn4c.gph cn4d.gph cn4e.gph cn4f.gph cn4h.gph , ///
	cols(4) altshrink ycommon graphr(color(white)) xsize(4) ysize(2) saving(cn4, replace)
	
//////Trump Thermometer:
///Table 3, Left Side:
svy: reg rtdjt3 age01 income01 gender educ01 white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4 
///Figure 1:
svy: reg rtdjt3 age01 income01 gender educ01 white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4 
quietly margins, at(ideo011=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Ideology", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Thermometer Rating") saving (cn5a, replace)
quietly margins, at(ptyid011=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Partisanship", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Thermometer Rating") saving (cn5b, replace)	
quietly margins, at(rrscal1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Racial Resentment", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Thermometer Rating") saving (cn5c, replace)	
quietly margins, at(rhsex1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Hostile Sexism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Thermometer Rating") saving (cn5d, replace)	
quietly margins, at(rauth1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Authoritarianism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Thermometer Rating") saving (cn5e, replace)
quietly margins, at(eret21=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Economic Dissatisfaction", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Thermometer Rating") saving (cn5f, replace)	
quietly margins, at(trscal1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Trust", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Thermometer Rating") saving (cn5h, replace)
quietly margins, at(rcnsc4=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Collective Narcissism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Thermometer Rating") saving (cn5g, replace)	
graph combine cn5g.gph cn5a.gph cn5b.gph cn5c.gph cn5d.gph cn5e.gph cn5f.gph cn5h.gph , ///
	cols(4) altshrink ycommon xsize(4) ysize(2) graphr(color(white)) saving(cn5, replace)	
	
//////Trump Trait Evaluation:
///Table 3, Right Side:
svy: reg rttrait3 age01 income01 gender educ01 white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4
///Figure 3:
svy: reg rttrait3 age01 income01 gender educ01 white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4
quietly margins, at(ideo011=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Ideology", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Trait Evaluation") saving (cn6a, replace)
quietly margins, at(ptyid011=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Partisanship", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Trait Evaluation") saving (cn6b, replace)	
quietly margins, at(rrscal1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Racial Resentment", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Trait Evaluation") saving (cn6c, replace)	
quietly margins, at(rhsex1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Hostile Sexism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Trait Evaluation") saving (cn6d, replace)	
quietly margins, at(rauth1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Authoritarianism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Trait Evaluation") saving (cn6e, replace)
quietly margins, at(eret21=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Economic Dissatisfaction", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Trait Evaluation") saving (cn6f, replace)
quietly margins, at(trscal1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Trust", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Trait Evaluation") saving (cn6h, replace)
quietly margins, at(rcnsc4=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Collective Narcissism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Trump Trait Evaluation") saving (cn6g, replace)	
graph combine cn6g.gph cn6a.gph cn6b.gph cn6c.gph cn6d.gph cn6e.gph cn6f.gph cn6h.gph , ///
	cols(4) altshrink ycommon xsize(4) ysize(2) graphr(color(white)) saving(cn6, replace)	

/////////Figure A1: Collective Narcissism Histogram
histogram rcnsc4, bin(31) frequency kdensity normal legend(cols(3))	
	
/////////Supplementary analyses: Net Evaluations of Donald Trump

//////Table A1, Left Side, Net Trump Thermometer:
svy: reg rdiff2013 age01 income01 gender educ01 white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4 
//////Figure A2:
svy: reg rdiff2013 age01 income01 gender educ01 white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4 
quietly margins, at(ideo011=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Ideology", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Thermometer Rating") saving (cn7a, replace)
quietly margins, at(ptyid011=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Partisanship", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Thermometer Rating") saving (cn7b, replace)	
quietly margins, at(rrscal1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Racial Resentment", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Thermometer Rating") saving (cn7c, replace)	
quietly margins, at(rhsex1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Hostile Sexism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Thermometer Rating") saving (cn7d, replace)	
quietly margins, at(rauth1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Authoritarianism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Thermometer Rating") saving (cn7e, replace)
quietly margins, at(eret21=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Economic Dissatisfaction", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Thermometer Rating") saving (cn7f, replace)
quietly margins, at(trscal1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Trust", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Thermometer Rating") saving (cn7h, replace)
quietly margins, at(rcnsc4=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Collective Narcissism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Thermometer Rating") saving (cn7g, replace)	
graph combine cn7g.gph cn7a.gph cn7b.gph cn7c.gph cn7d.gph cn7e.gph cn7f.gph cn7h.gph, ///
	cols(4) altshrink ycommon xsize(4) ysize(2) graphr(color(white)) saving(cn7, replace)	

//////Table A1, Right Side, Net Trump Trait Evaluation:
svy: reg rtdiff2013 age01 income01 gender educ01 white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4
//////Figure A3:
svy: reg rtdiff2013 age01 income01 gender educ01 white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4
quietly margins, at(ideo011=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Ideology", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Trait Evaluation") saving (cn8a, replace)
quietly margins, at(ptyid011=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Partisanship", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Trait Evaluation") saving (cn8b, replace)	
quietly margins, at(rrscal1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Racial Resentment", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Trait Evaluation") saving (cn8c, replace)	
quietly margins, at(rhsex1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Hostile Sexism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Trait Evaluation") saving (cn8d, replace)	
quietly margins, at(rauth1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Authoritarianism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Trait Evaluation") saving (cn8e, replace)
quietly margins, at(eret21=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Economic Dissatisfaction", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Trait Evaluation") saving (cn8f, replace)	
quietly margins, at(trscal1=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Trust", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Trait Evaluation") saving (cn8h, replace)
quietly margins, at(rcnsc4=(0(.1)1))
marginsplot, recast(line) recastci(rline) plotop(lcolor(black)) ciopt(color(gs8) lp(dash))  ///
	ylabel(0 (.2) 1, gmin gmax nogex) xlabel (0 (.2) 1) graphr(c(white) lc(white)) plotr(lc(black)) ///
	title ("Collective Narcissism", color(black) size(vlarge)) ///
	xtitle("") ytitle("Net Trump Trait Evaluation") saving (cn8g, replace)	
graph combine cn8g.gph cn8a.gph cn8b.gph cn8c.gph cn8d.gph cn8e.gph cn8f.gph cn8h.gph, ///
	cols(4) altshrink ycommon xsize(4) ysize(2) graphr(color(white)) saving(cn8, replace)	

/////////Robustness Check: Education as a Series of Dummy Variables.

//////Table A2, Vote Choice:
svy: probit trv4 age01 income01 gender i.educ white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4
mchange, stats(ch) brief

//////Table A3, Left Side, Trump Thermometer:
svy: reg rtdjt3 age01 income01 gender i.educ white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4 

//////Table A3, Right Side, Trump Trait Evaluation:
svy: reg rttrait3 age01 income01 gender i.educ white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4

/////////Robustness Check: Correcting for Errors-in-Variables.

//////Table A4, Vote Choice (Estimated in Mplus):
///Define variable counting # of missing cases in Table 2 analysis:
egen miss1=rowmiss(trv4 age01 income01 gender educ01 white amerid1 ideo011 ptyid011 rrscal1 rhsex1 rauth1 eret21 trscal1 rcnsc4)
///Computation of error variances, using only cases in Table 2 analysis:
///Standard deviations produced by <estat sd> were squared to obtain variable variances:
svy: mean rauth1 if miss1==0
estat sd
///var = .09685608
display .09685608*(1-.60)
/// .03874243
svy: mean rrscal1 if miss1==0
estat sd
///var = .07037125
display .07037125*(1-.84)
/// .0112594
svy: mean rhsex1 if miss1==0
estat sd
///var = .06620782
display .06620782*(1-.85)
/// .00993117
svy: mean trscal1 if miss1==0
estat sd
///var = .03079151
display .03079151*(1-.75)
/// .00769788
svy: mean rcnsc4 if miss1==0
estat sd
///var = .04244206
display .04244206*(1-.83)
/// .00721515

//////Table A5, Left Side, Trump Thermometer:
svy: sem (rauth1 <- Rauth1) ///
		 (rrscal1 <- Rrscal1) ///
		 (rhsex1 <- Rhsex1) ///
		 (trscal1 <- Trscal1) ///
		 (rcnsc4 <- Rcnsc4) ///
	     (rtdjt3 <- age01 income01 gender educ01 white amerid1 ideo011 ptyid011 eret21) ///
		 (rtdjt3 <- Rauth1) (rtdjt3 <- Rrscal1) (rtdjt3 <- Rhsex1) (rtdjt3 <- Trscal1) (rtdjt3 <- Rcnsc4), ///
		 reliability (rauth1 .60 rrscal1 .84 rhsex1 .85 trscal1 .75 rcnsc4 .83)
estat gof, stats(chi2 rmsea res indices)
estat eqgof

//////Table A5, Right Side, Trump Trait Evaluation:
svy: sem (rauth1 <- Rauth1) ///
		 (rrscal1 <- Rrscal1) ///
		 (rhsex1 <- Rhsex1) ///
		 (trscal1 <- Trscal1) ///
		 (rcnsc4 <- Rcnsc4) ///
	     (rttrait3 <- age01 income01 gender educ01 white amerid1 ideo011 ptyid011 eret21) ///
		 (rttrait3 <- Rauth1) (rttrait3 <- Rrscal1) (rttrait3 <- Rhsex1) (rttrait3 <- Trscal1) (rttrait3 <- Rcnsc4), ///
		 reliability (rauth1 .60 rrscal1 .84 rhsex1 .85 trscal1 .75 rcnsc4 .83)
estat gof, stats(chi2 rmsea res indices)
estat eqgof
